Dynomotion

Group: DynoMotion Message: 9672 From: Sam Marrocco Date: 6/22/2014
Subject: KMotion.dotnet KM_Axis.SetCurrentPosition does nothing
I have motor motion and interpreter working. Controller.GetAxis() returns what appears to be a valid KM_Axis, which can be used with it's .ZeroAxis() method to reset the axis current position to 0. However, trying to use the same KM_Axis with it's .SetCurrentPosition() seems to do nothing. Is there something that must be done before calling .SetCurrentPosition() ?
--

sam marrocco | chief technical officer
ringside.cutters.picnic.moonlink

248 548 2500 w
248 910 3344 c

ringsidecreative.com

Group: DynoMotion Message: 9673 From: Sam Marrocco Date: 6/23/2014
Subject: KMotion.dotnet KM_Axis.SetCurrentPosition does nothing
I have motor motion and interpreter working and Controller.GetAxis() returns what appears to be a valid KM_Axis, which can be used with it's .ZeroAxis() method to reset the axis current position to 0. However, trying to use the same KM_Axis with it's .SetCurrentPosition() seems to do nothing. Is there something that must be done before calling .SetCurrentPosition() ?


--

sam marrocco | chief technical officer
ringside.cutters.picnic.moonlink

248 548 2500 w
248 910 3344 c

ringsidecreative.com

Group: DynoMotion Message: 9675 From: Tom Kerekes Date: 6/23/2014
Subject: Re: KMotion.dotnet KM_Axis.SetCurrentPosition does nothing
Hi Sam,

KFLOP refers to the the currently Commanded Destination as "Dest".  It refers to the currently measured Position as "Position".  Usually the DRO's display the commanded Destination not the measured Position - especially if you don't have feedback.  So possibly that explains why you don't see any effect?

It normally doesn't make sense to change the Commanded Destination as this would cause a discontinuity in the commanded position and most likely a violent jump in the axis.  So normally the axis should be disabled and then re-enabled with the new Destination using the KFLOP command EnableAxisDest.  Or something like:

            _Controller.WriteLine(String.Format("EnableAxisDest{0} {1}", MyAxis, MyDest));

HTH
Regards
TK





From: "Sam Marrocco SMarrocco@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Monday, June 23, 2014 5:28 AM
Subject: [DynoMotion] KMotion.dotnet KM_Axis.SetCurrentPosition does nothing

 
I have motor motion and interpreter working and Controller.GetAxis() returns what appears to be a valid KM_Axis, which can be used with it's .ZeroAxis() method to reset the axis current position to 0. However, trying to use the same KM_Axis with it's .SetCurrentPosition() seems to do nothing. Is there something that must be done before calling .SetCurrentPosition() ?


--

sam marrocco | chief technical officer
ringside.cutters.picnic.moonlink

248 548 2500 w
248 910 3344 c

ringsidecreative.com



Group: DynoMotion Message: 9676 From: Sam Marrocco Date: 6/23/2014
Subject: Re: KMotion.dotnet KM_Axis.SetCurrentPosition does nothing

On 6/23/2014 12:59 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi Sam,

KFLOP refers to the the currently Commanded Destination as "Dest".  It refers to the currently measured Position as "Position".  Usually the DRO's display the commanded Destination not the measured Position - especially if you don't have feedback.  So possibly that explains why you don't see any effect?

It normally doesn't make sense to change the Commanded Destination as this would cause a discontinuity in the commanded position and most likely a violent jump in the axis.  So normally the axis should be disabled and then re-enabled with the new Destination using the KFLOP command EnableAxisDest.  Or something like:

            _Controller.WriteLine(String.Format("EnableAxisDest{0} {1}", MyAxis, MyDest));




I think I understand the logic.

But....if the DROs do not change for KM_Axis.SetCurrentPosition, for which the docs state: "Sets the axis node's current position. Can be used to "zero" the axis"

then why would they update for KM_Axis.ZeroAxis, for which the docs state: "Sets the Axis' current 0.0 point"

Since both methods are effectively setting the current position, shouldn't they *both* change the DRO (or not)?




sam marrocco | chief technical officer
ringside.cutters.picnic.moonlink

248 548 2500 w
248 910 3344 c

ringsidecreative.com

Group: DynoMotion Message: 9678 From: Tom Kerekes Date: 6/23/2014
Subject: Re: KMotion.dotnet KM_Axis.SetCurrentPosition does nothing
Hi Sam,

The KFLOP "Zero" command is a special command which basically disables the Axis, Zeros both the commanded destination and the measured position, and re-enables the axis all between servo samples.

HTH
Regards
TK

Group: DynoMotion Message: 9680 From: Sam Marrocco Date: 6/23/2014
Subject: Re: KMotion.dotnet KM_Axis.SetCurrentPosition does nothing

On 6/23/2014 1:27 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi Sam,

The KFLOP "Zero" command is a special command which basically disables the Axis, Zeros both the commanded destination and the measured position, and re-enables the axis all between servo samples.


So if I want to set the current position to something other than zero and have the DRO update (similiar to .ZeroAxis but with a custom value), I should disable the axis, set the commanded destination and position, then re-enable the axis with:

KM_Axis.Disable()
KM_Axis.SetCurrentPosition(1.0)
KM_Axis.Enable()




sam marrocco | chief technical officer
ringside.cutters.picnic.moonlink

248 548 2500 w
248 910 3344 c

ringsidecreative.com

Group: DynoMotion Message: 9684 From: Tom Kerekes Date: 6/23/2014
Subject: Re: KMotion.dotnet KM_Axis.SetCurrentPosition does nothing
Hi Sam,

Your code only sets the Encoder Position.  Your code does not set the Commanded Destination.  However Enable() will set the Destination to the currently measured Position.  So that may work for you.  I'm not sure exactly what you are trying to do or if you have encoder feedback or not.  Because this code runs on the PC it is not always real-time.  So a small possibility exists that there may be a significant delay (1 second?) between the time you set the Encoder Position to 1.0 and the axis is enabled.  Within this time the axis may move or drift.  Even in a best case scenario the delay may be several milliseconds.  If this potential drift is an issue for you you might then do a move back to your desired Destination.

Or use the EnableAxisDest described in my previous post might be more appropriate especially for open-loop systems.

Regards
TK

Group: DynoMotion Message: 9688 From: Sam Marrocco Date: 6/24/2014
Subject: Re: KMotion.dotnet KM_Axis.SetCurrentPosition does nothing

On 6/23/2014 7:53 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi Sam,

Your code only sets the Encoder Position.  Your code does not set the Commanded Destination.  However Enable() will set the Destination to the currently measured Position.  So that may work for you.  I'm not sure exactly what you are trying to do or if you have encoder feedback or not.  Because this code runs on the PC it is not always real-time.  So a small possibility exists that there may be a significant delay (1 second?) between the time you set the Encoder Position to 1.0 and the axis is enabled.  Within this time the axis may move or drift.  Even in a best case scenario the delay may be several milliseconds.  If this potential drift is an issue for you you might then do a move back to your desired Destination.

Or use the EnableAxisDest described in my previous post might be more appropriate especially for open-loop systems.



It does appear to be working as you say is possible. To be clear, I have no encoder feedback; this is being used purely for motor control.
Basically I'm trying to tell the KFlop "this axis is now sitting at this point in space".
Is there a way to change the CommandedDestination from the KM_Axis object? I see a SetCommandedDest?


sam marrocco | chief technical officer
ringside.cutters.picnic.moonlink

248 548 2500 w
248 910 3344 c

ringsidecreative.com

Group: DynoMotion Message: 9693 From: Tom Kerekes Date: 6/24/2014
Subject: Re: KMotion.dotnet KM_Axis.SetCurrentPosition does nothing
Hi Sam,

We've added:

        /// <summary>
        /// Sets the axis node's commanded Destination
        /// Caution: changing this may result in a sudden jump in the axis position
        /// </summary>
        /// <param name="dest">new value for the commanded destination</param>
        public void SetCommandedDest(double dest)

and

        /// <summary>
        /// Bring an axis to an enabled state and specify the commanded destination for the axis
        /// dest is multiplied by CPU and sent to KFLOP
        /// </summary>
        public void EnableDest(double dest)

to the KM_Axis Class.  They will be in the next Version.  A workaround in the mean time is o use the Script command as described previously.

Regards
TK



From: "Sam Marrocco SMarrocco@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Tuesday, June 24, 2014 6:38 AM
Subject: Re: [DynoMotion] KMotion.dotnet KM_Axis.SetCurrentPosition does nothing

 

On 6/23/2014 7:53 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi Sam,

Your code only sets the Encoder Position.  Your code does not set the Commanded Destination.  However Enable() will set the Destination to the currently measured Position.  So that may work for you.  I'm not sure exactly what you are trying to do or if you have encoder feedback or not.  Because this code runs on the PC it is not always real-time.  So a small possibility exists that there may be a significant delay (1 second?) between the time you set the Encoder Position to 1.0 and the axis is enabled.  Within this time the axis may move or drift.  Even in a best case scenario the delay may be several milliseconds.  If this potential drift is an issue for you you might then do a move back to your desired Destination.

Or use the EnableAxisDest described in my previous post might be more appropriate especially for open-loop systems.



It does appear to be working as you say is possible. To be clear, I have no encoder feedback; this is being used purely for motor control.
Basically I'm trying to tell the KFlop "this axis is now sitting at this point in space".
Is there a way to change the CommandedDestination from the KM_Axis object? I see a SetCommandedDest?


sam marrocco | chief technical officer
ringside.cutters.picnic.moonlink

248 548 2500 w
248 910 3344 c

ringsidecreative.com